package com.cloud.fallback;

import com.cloud.feign.Service2Feign;
import feign.hystrix.FallbackFactory;
import org.springframework.stereotype.Component;

/**
 * @Author: TongRui乀
 * @Date: 2019/10/25 11:04
 * @description：
 */
@Component
public class FeignFallback implements FallbackFactory<Service2Feign> {
    @Override
    public Service2Feign create(Throwable throwable) {
        return new Service2Feign() {
            @Override
            public String hello() {
                return null;
            }

            @Override
            public String timeout() {
                return "Feign Fallback";
            }
        };
    }
}
